home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_7661_000039.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  1.8 KB

  1. Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!sun4nl!wtrlnd!desert.wlink.nl!Jaba
  2. From: Jaba@desert.wlink.nl (Jan van.den.Baard)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Boopsi, layers and clipping???
  5. Message-ID: <Jaba.0i34@desert.wlink.nl>
  6. Date: 20 Mar 94 16:41:18 GMT
  7. Distribution: world
  8. Organization: Digital Desert
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-GateSoftware: AmiGate 0.16 (25.2.94)
  13. Lines: 53
  14.  
  15. Hello Patrik,
  16. In a message of 19 Mar 94 you wrote about Boopsi, layers and clipping???:
  17.  
  18.  PL> Hello!
  19.  
  20.  PL> Here's a delicate problem for someone to solve!
  21.  
  22.  PL> What's the proper way to do clipping when rendering a boopsi-gadget?
  23.  
  24.  PL> I've tried the following:
  25.  
  26.  PL> ...
  27.  
  28.  PL>     struct GadgetInfo *ginfo = msg->gpr_GInfo;;
  29.  PL>     struct Region *old;
  30.  
  31.  PL>     LockLayerInfo(ginfo->gi_Layer->LayerInfo);
  32.  PL>     LockLayer(NULL, ginfo->gi_Layer);
  33.  
  34.  PL>     old = InstallClipRegion(ginfo->gi_Layer, myclipregion);
  35.  
  36.  PL>     ... Rendering ...
  37.  
  38.  PL>     InstallClipRegion(ginfo->gi_Layer, old);
  39.  PL>     UnlockLayer(ginfo->gi_Layer);
  40.  PL>     UnlockLayerInfo(ginfo->gi_Layer->LayerInfo);
  41.  
  42.  Try this.
  43.  
  44.         struct GadgetInfo *ginfo = msg->gpr_GInfo;
  45.         struct Region *old;
  46.         BOOL update = FALSE;
  47.  
  48.         if ( ginfo->gi_Layer->Flags & LAYERUPDATING ) {
  49.                 EndUpdate( ginfo->gi_Layer, FALSE );
  50.                 update = TRUE;
  51.         }
  52.  
  53.         old = InstallClipRegion(ginfo->gi_Layer, myclipregion);
  54.  
  55.         ... Rendering ...
  56.  
  57.         InstallClipRegion(ginfo->gi_Layer, old);
  58.  
  59.         if ( update )
  60.                 BeginUpdate( ginfo->gi_Layer );
  61.  
  62. Bye,
  63.          // Jaba Development
  64.         //  Fido : 2:285/404.29 (Jan van.den.Baard)
  65.     \\ //   Fido : 2:285/502.7    "   "   "    "
  66.      \X/    EMail: jaba@desert.wlink.nl
  67.